#ifndef CALIBRATION_POSITIONSET_HPP_
#define CALIBRATION_POSITIONSET_HPP_

//-----------------------------------------------------------------
// Includes
//-----------------------------------------------------------------
#include "Dataset.hpp"
#include "Pattern.hpp"
#include "../Vision/Camera.hpp"
#include "../Tools/Exceptions.hpp"
#include "../Tools/Singleton.hpp"
#include "../Tools/mat44.hpp"
#include <map>
	
namespace Calibration
{
	//-----------------------------------------------------------------
	// Cette classe décrit la processus de calibrage
	//-----------------------------------------------------------------
	class CalibrationPositionSet
	{	
	public:	
		//-------------------------------------------------------------
		// Structure 
		//-------------------------------------------------------------
		struct Position
		{
			float translation[16];
			float rotation[16];
			Position( float* t, float* r )
			{
				Tools::mat44_copy( translation, t );
				Tools::mat44_copy( rotation, r );
			}

			Position( )
			{
				Tools::mat44_identity( translation );
				Tools::mat44_identity( rotation );
			}

			Position( const Position& copy )
			{
				Tools::mat44_copy( translation, copy.translation );
				Tools::mat44_copy( rotation, copy.rotation );
			}
		};

		//-------------------------------------------------------------
		// Constructeur
		//-------------------------------------------------------------
		CalibrationPositionSet();

		//-------------------------------------------------------------
		// Destructeur
		//-------------------------------------------------------------
		virtual ~CalibrationPositionSet();
		
		//-------------------------------------------------------------
		//
		//-------------------------------------------------------------
		void AddPosition( float* translationMatrix, float* rotationMatrix, int dataIndex );

		//-------------------------------------------------------------
		//
		//-------------------------------------------------------------
		Position* GetPosition( int dataIndex );

	protected:
		//-------------------------------------------------------------
		// Type
		//-------------------------------------------------------------
		typedef std::map< int, Position > PositionMap;

		//-------------------------------------------------------------
		// Type
		//-------------------------------------------------------------
		PositionMap positionMap;

		//-------------------------------------------------------------
		// Constructeur et opérator d'affectation
		// -> empeche la construction direct d'objet
		//-------------------------------------------------------------		
		CalibrationPositionSet(const CalibrationPositionSet & copy);
		CalibrationPositionSet & operator=(const CalibrationPositionSet & copy);
	};
}

#endif /*CALIBRATION_POSITIONSET_HPP*/
